import { Inject, Injectable } from "@nestjs/common";
import {
  EnumMicroService,
  SysIntervalMsgType,
} from "../../../../../types/types";
import { NatsClientService } from "@app/nats-client";

@Injectable()
export class TransportWithinServiceService {
  @Inject(NatsClientService)
  private natsClient: NatsClientService;

  constructor() {}

  onModuleInit(): any {}

  sendSysMsg(msg: any): any {
    this.natsClient.emit(SysIntervalMsgType.GATEWAY_FE_EXCHANGE_EVENT, {
      fromServerType: EnumMicroService.system,
      msg,
    });
  }

  sendMachineMsg(msg: any) {
    // this.transportService.sendMsg({
    //   toServiceType: EnumMicroService.gateway,
    //   fromServiceType: EnumMicroService.system,
    //   eventType: SysIntervalMsgType.SYSTEM_GATEWAY_EXCHANGE_EVENT,
    //   msg
    // });
  }
}
